<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>优惠券</title>
    <link rel="stylesheet" href="<?php echo IMG_PATH ?>bdkd/css/reset.css">
    <!--	<link rel="stylesheet" href="--><?php //echo IMG_PATH ?><!--bdkd/css/you_scss.css">-->
    <script src="http://g.tbcdn.cn/mtb/lib-flexible/0.3.4/??flexible_css.js,flexible.js"></script>
    <script src="<?php echo IMG_PATH ?>bdkd/js/jquery-1.11.1.min.js"></script>
    <style>
        body, html {
            height: 100%;
            overflow: scroll;
            background: #f2f2f2; }
        body .dzq .dazhequan, html .dzq .dazhequan {
            width: 9.62667rem;
            height: 3.73333rem;
            margin: 0.26667rem auto;
            background-image: url(<?php echo IMG_PATH ?>bdkd/img/rjx-one.png);
            background-size: 100%;
            background-repeat: no-repeat;
            border-radius: 10px; }
        body .dzq .dazhequan .qi, html .dzq .dazhequan .qi {
            width: 100%;
            height: 2.73333rem;
            display: flex; }
        body .dzq .dazhequan .qi span:nth-child(1), html .dzq .dazhequan .qi span:nth-child(1) {
            font-size: 48px;
            color: #14a4fb;
            margin-left: 0.74667rem;
            line-height: 2.73333rem;
            margin-right: 0.13333rem; }
        [data-dpr="2"] body .dzq .dazhequan .qi span:nth-child(1), [data-dpr="2"] html .dzq .dazhequan .qi span:nth-child(1) {
            font-size: 96px; }
        [data-dpr="3"] body .dzq .dazhequan .qi span:nth-child(1), [data-dpr="3"] html .dzq .dazhequan .qi span:nth-child(1) {
            font-size: 144px; }
        body .dzq .dazhequan .qi span:nth-child(2), html .dzq .dazhequan .qi span:nth-child(2) {
            font-size: 24px;
            color: #14a4fb;
            font-weight: 900;
            line-height: 3.13333rem; }
        [data-dpr="2"] body .dzq .dazhequan .qi span:nth-child(2), [data-dpr="2"] html .dzq .dazhequan .qi span:nth-child(2) {
            font-size: 48px; }
        [data-dpr="3"] body .dzq .dazhequan .qi span:nth-child(2), [data-dpr="3"] html .dzq .dazhequan .qi span:nth-child(2) {
            font-size: 72px; }
        body .dzq .dazhequan .qi div, html .dzq .dazhequan .qi div {
            text-align: center;
            margin-left: 0.34667rem; }
        body .dzq .dazhequan .qi div h1, html .dzq .dazhequan .qi div h1 {
            font-size: 24px;
            color: #ff6364;
            letter-spacing: 0.13333rem;
            margin-top: 0.74667rem;
            margin-bottom: 0.24rem;
            font-weight: 900; }
        [data-dpr="2"] body .dzq .dazhequan .qi div h1, [data-dpr="2"] html .dzq .dazhequan .qi div h1 {
            font-size: 48px; }
        [data-dpr="3"] body .dzq .dazhequan .qi div h1, [data-dpr="3"] html .dzq .dazhequan .qi div h1 {
            font-size: 72px; }
        body .dzq .dazhequan .qi div p, html .dzq .dazhequan .qi div p {
            font-size: 10px;
            color: #999;
            font-weight: 500; }
        [data-dpr="2"] body .dzq .dazhequan .qi div p, [data-dpr="2"] html .dzq .dazhequan .qi div p {
            font-size: 20px; }
        [data-dpr="3"] body .dzq .dazhequan .qi div p, [data-dpr="3"] html .dzq .dazhequan .qi div p {
            font-size: 30px; }
        body .dzq .dazhequan .xiawenzi1, html .dzq .dazhequan .xiawenzi1 {
            width: 100%;
            height: 0.93333rem; }
        body .dzq .dazhequan .xiawenzi1 p, html .dzq .dazhequan .xiawenzi1 p {
            line-height: 0.93333rem;
            font-size: 11px;
            color: #999;
            margin-left: 0.61333rem; }
        [data-dpr="2"] body .dzq .dazhequan .xiawenzi1 p, [data-dpr="2"] html .dzq .dazhequan .xiawenzi1 p {
            font-size: 22px; }
        [data-dpr="3"] body .dzq .dazhequan .xiawenzi1 p, [data-dpr="3"] html .dzq .dazhequan .xiawenzi1 p {
            font-size: 33px; }
        body .dqq .daiququan, html .dqq .daiququan {
            width: 9.62667rem;
            height: 3.73333rem;
            margin: 0.26667rem auto;
            background-image: url(<?php echo IMG_PATH ?>bdkd/img/rjx-two.png);
            background-size: 100%;
            background-repeat: no-repeat;
            border-radius: 10px; }
        body .dqq .daiququan .qi, html .dqq .daiququan .qi {
            width: 100%;
            height: 2.73333rem;
            display: flex; }
        body .dqq .daiququan .qi span:nth-child(1), html .dqq .daiququan .qi span:nth-child(1) {
            font-size: 48px;
            color: #14a4fb;
            margin-left: 0.74667rem;
            line-height: 2.73333rem;
            margin-right: 0.13333rem; }
        [data-dpr="2"] body .dqq .daiququan .qi span:nth-child(1), [data-dpr="2"] html .dqq .daiququan .qi span:nth-child(1) {
            font-size: 96px; }
        [data-dpr="3"] body .dqq .daiququan .qi span:nth-child(1), [data-dpr="3"] html .dqq .daiququan .qi span:nth-child(1) {
            font-size: 144px; }
        body .dqq .daiququan .qi span:nth-child(2), html .dqq .daiququan .qi span:nth-child(2) {
            font-size: 24px;
            color: #14a4fb;
            font-weight: 900;
            line-height: 3.13333rem; }
        [data-dpr="2"] body .dqq .daiququan .qi span:nth-child(2), [data-dpr="2"] html .dqq .daiququan .qi span:nth-child(2) {
            font-size: 48px; }
        [data-dpr="3"] body .dqq .daiququan .qi span:nth-child(2), [data-dpr="3"] html .dqq .daiququan .qi span:nth-child(2) {
            font-size: 72px; }
        body .dqq .daiququan .qi div, html .dqq .daiququan .qi div {
            text-align: center;
            margin-left: 0.34667rem; }
        body .dqq .daiququan .qi div h1, html .dqq .daiququan .qi div h1 {
            font-size: 24px;
            color: #ff6364;
            letter-spacing: 0.13333rem;
            margin-top: 0.74667rem;
            margin-bottom: 0.24rem;
            font-weight: 900; }
        [data-dpr="2"] body .dqq .daiququan .qi div h1, [data-dpr="2"] html .dqq .daiququan .qi div h1 {
            font-size: 48px; }
        [data-dpr="3"] body .dqq .daiququan .qi div h1, [data-dpr="3"] html .dqq .daiququan .qi div h1 {
            font-size: 72px; }
        body .dqq .daiququan .qi div p, html .dqq .daiququan .qi div p {
            font-size: 10px;
            color: #999;
            font-weight: 500; }
        [data-dpr="2"] body .dqq .daiququan .qi div p, [data-dpr="2"] html .dqq .daiququan .qi div p {
            font-size: 20px; }
        [data-dpr="3"] body .dqq .daiququan .qi div p, [data-dpr="3"] html .dqq .daiququan .qi div p {
            font-size: 30px; }
        body .dqq .daiququan .xiawenzi1, html .dqq .daiququan .xiawenzi1 {
            width: 100%;
            height: 0.93333rem; }
        body .dqq .daiququan .xiawenzi1 p, html .dqq .daiququan .xiawenzi1 p {
            line-height: 0.93333rem;
            font-size: 11px;
            color: #999;
            margin-left: 0.61333rem; }
        [data-dpr="2"] body .dqq .daiququan .xiawenzi1 p, [data-dpr="2"] html .dqq .daiququan .xiawenzi1 p {
            font-size: 22px; }
        [data-dpr="3"] body .dqq .daiququan .xiawenzi1 p, [data-dpr="3"] html .dqq .daiququan .xiawenzi1 p {
            font-size: 33px; }
        body .dibu, html .dibu {
            width: 100%;
            height: 0.33333rem;
            margin-top: 0.53333rem;
            display: flex;
            justify-content: center;
            align-items: center; }
        body .dibu span, html .dibu span {
            font-size: 11px;
            color: #d4d4d4; }
        [data-dpr="2"] body .dibu span, [data-dpr="2"] html .dibu span {
            font-size: 22px; }
        [data-dpr="3"] body .dibu span, [data-dpr="3"] html .dibu span {
            font-size: 33px; }
        body .dibu span:nth-child(1), html .dibu span:nth-child(1) {
            display: block;
            width: 1.6rem;
            height: 0.02667rem;
            background: #d4d4d4;
            margin-left: 0.29333rem;
            margin-right: 0.29333rem; }
        body .dibu span:nth-child(3), html .dibu span:nth-child(3) {
            display: block;
            width: 1.6rem;
            height: 0.02667rem;
            background: #d4d4d4;
            margin-left: 0.29333rem;
            margin-right: 0.29333rem; }

        /*# sourceMappingURL=you_scss.css.map */

    </style>
</head>
<body>
<input type="hidden" id="type" value="<?php echo $type; ?>">
<input type="hidden" id="id" value="<?php
if(isset($id) && !empty($id)){
    echo $id;
}

?>">
<?php
if(empty($list)){
    ?>
    <div class="ycl-bug">
        <div class="ycl-bug1">
            <img src="<?php echo IMG_PATH ?>bdkd/img/yhq-pic.png" alt="">
            <p>抱歉，您还没有优惠券</p>
        </div>
    </div>
    <?php
}else{
    ?>
    <div class="waikuang">
        <ul class="dzq">
            <?php
            foreach ($list as $value){
                if($value['type']==2){
                    ?>
                    <li class="daiququan">
                        <div class="qi">
                            <span><?php echo $value['discount']*10?></span>
                            <span>折</span>
                            <div>
                                <h1>代取券</h1>
                                <p>有效期至 : <?php echo date("Y-m-d",$value['end_time'])?></p>
                            </div>
                        </div>
                        <div class="xiawenzi1">
                            <p>仅限于 "取快递" 付款时使用</p>
                        </div>
                    </li>
                    <?php
                }else{
                    ?>
                    <li class="dazhequan">
                        <div class="qi">
                            <span><?php echo $value['discount']*10?></span>
                            <span>折</span>
                            <div>
                                <h1>打折券</h1>
                                <p>有效期至 : <?php echo date("Y-m-d",$value['end_time'])?></p>
                            </div>
                        </div>
                        <div class="xiawenzi1">
                            <p>仅限于 "寄快递" 和 "物流托运" 付款时使用</p>
                        </div>
                    </li>
                    <?php
                }
            }
            ?>
        </ul>

    </div>
    <div class="dibu">
        <span></span>
        <span>您的优惠券就这么多了</span>
        <span></span>
    </div>
    <?php
}
?>
<!--	<script src="--><?php //echo IMG_PATH ?><!--bdkd/js/you.js"></script>-->
<script>
    var type=$("#type").val();
    var id=$("#id").val();
    if(type==0){
        //alert(333);
        //从个人中心页面进来不能点击变色
        /*$('.daiququan1,.daiququan7').click(function(){
            $('.qi1 span').css('color','#14a4fb');
            $('.qi7 span').css('color','#14a4fb');
        })
        var zhekou1 = $('.qi1 span:first').html();
        console.log(zhekou1);*/
    }else {
        //从支付页面进来点击变色&&要传入点击了哪个优惠券的参数&&跳转到支付页面

        $('.dzq li').each(function(index,item){
            $(item).click(function(){
                $('.waikuang ul li .qi span').css('color','#14a4fb');
                $(this).children().eq(0).children().eq(0).css('color','#ff6364');
                $(this).children().eq(0).children().eq(1).css('color','#ff6364');
                $(this).children().eq(0).children().eq(0).css('color','#ff6364');
                var zhekou1 = $(this).children().eq(0).children().eq(0).html();
                window.location.href = '<?php echo SITE_PATH ?>work/bpost/wxqpay?id='+id+'&zhekou='+zhekou1;
            })
        })

        $('.dqq li').each(function(index,item){
            $(item).click(function(){
                $('.waikuang ul li .qi span').css('color','#14a4fb');
                $(this).children().eq(0).children().eq(0).css('color','#ff6364');
                $(this).children().eq(0).children().eq(1).css('color','#ff6364');
                $(this).children().eq(0).children().eq(0).css('color','#ff6364');
                var zhekou2 = $(this).children().eq(0).children().eq(0).html();
                window.location.href = '<?php echo SITE_PATH ?>work/bpost/wxqpay?id='+id+'&zhekou='+zhekou2;
            })
        })

    }


</script>
</body>
</html>